package com.zhss.concurrency;

/**
 * @ClassName com.zhss.concurrency.JoinDemo
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/6/15 14:55
 * @Version 1.0
 */
public class JoinDemo {
	public static void main(String[] args) throws InterruptedException {
		final Thread t1 = new Thread(() -> {
			System.out.println("不知名线程被执行");
			try {
				Thread.sleep(10*1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("不知名线程被执行2");
		});
		final Thread t2 = new Thread(() -> {
			t1.interrupt();
		});


		t1.start();
		t2.start();
		t1.join();
	}
}
